/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package sonia.golf.view;

//~--- non-JDK imports --------------------------------------------------------

import android.app.Activity;

/**
 *
 * @author Sebastian Sdorra
 */
public class DefaultNewItemDialog extends AbstractNewItemDialog
{

  /**
   * Constructs ...
   *
   *
   * @param activity
   * @param messageId
   */
  public DefaultNewItemDialog(Activity activity, int messageId)
  {
    super(activity);
    this.messageId = messageId;
  }

  //~--- set methods ----------------------------------------------------------

  /**
   * Method description
   *
   *
   * @param onOkListener
   */
  public void setOnOkListener(OnOkListener onOkListener)
  {
    this.onOkListener = onOkListener;
  }

  //~--- methods --------------------------------------------------------------

  /**
   * Method description
   *
   */
  @Override
  protected void onCancel()
  {

    // do nothing
  }

  /**
   * Method description
   *
   *
   * @param name
   */
  @Override
  protected void onOk(String name)
  {
    if (onOkListener != null)
    {
      onOkListener.onOk(name);
    }
  }

  //~--- get methods ----------------------------------------------------------

  /**
   * Method description
   *
   *
   * @return
   */
  @Override
  protected int getMessageId()
  {
    return messageId;
  }

  //~--- fields ---------------------------------------------------------------

  /** Field description */
  private int messageId;

  /** Field description */
  private OnOkListener onOkListener;
}
